package DRCOMM;

import java.util.Map;

import DRC.DRCDB;

public abstract class DRHTTP_API {

    public DRCDB drcdb=null;
    public String URI=null;
    public String result=null;
    public Map<String, Object> parameters=null;

    public DRHTTP_API(DRCDB drcdb,String URI){
        this.drcdb=drcdb;
        this.URI=URI;
    }

    public String get_parameters(Map<String, Object> parameters,String key){
        String result="";
        this.parameters=parameters;
        if(this.parameters.containsKey(key)){
            if(this.parameters.get(key)!=null)
                result=this.parameters.get(key).toString();
        }
        return result;
    }

    public Object get_parameterItem(Map<String,Object> parameters,String key){
        HttpRequestFormResolver.ParamItem result=null;
        if(this.parameters.containsKey(key)){
            if(this.parameters.get(key)!=null)
                return this.parameters.get(key);
        }
        return result;
    }

    public abstract String getResult(Map<String, Object> parameters,DR_SESSION drs);

}